Repository navigation
Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
4 open findings
This introduces C++20-only features in implementation code: abbreviated function templates (`const… · NewAppendOptionalalways appends viaAppendInt(... int64_t ...), but column 4 in this table schema… · New This introduces C++20-only features in implementation code: abbreviated function templates (`const… · New The new stream implementation adds batching logic viaMetadataTable::kBatchSize, but the added… · New
What changed in this PR
This PR adds an inspect metadata table (RefsTable) that exposes Iceberg branch/tag snapshot references as an Arrow stream, along with a shared internal helper for emitting bounded Arrow record batches.
Changes:
- Introduces
RefsTable(schema + scan implementation) and wires it into the metadata table kind enum / build system. - Adds a shared internal Arrow row-stream helper to generate bounded Arrow batches from row iterators.
- Adds
RefsTableunit tests (format v2/v3) and integrates them into the test target.
| File | Description |
|---|---|
| src/iceberg/type_fwd.h | Adds forward declaration for RefsTable. |
| src/iceberg/inspect/metadata_table.h | Adds kRefs metadata table kind. |
| src/iceberg/inspect/refs_table.h | Declares the new RefsTable metadata table API. |
| src/iceberg/inspect/refs_table.cc | Implements RefsTable schema + scanning over snapshot refs; sorts results. |
| src/iceberg/inspect/metadata_table_stream_internal.h | Adds internal Arrow stream implementation for iterating rows in bounded batches. |
| src/iceberg/test/inspect/refs_table_test.cc | Adds tests validating schema, sorting, and retention-field projection. |
| src/iceberg/test/CMakeLists.txt | Registers the new refs table tests in the test target. |
| src/iceberg/cpp20_compatibility_internal.h | Includes the new header for compatibility aggregation. |
| src/iceberg/CMakeLists.txt | Adds inspect/refs_table.cc to library sources. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Move the common metadata test fixture into inspect and update history and snapshots includes to match PR apache#1007. Co-authored-by: Codex <codex@openai.com>
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open findings
3 resolved since last review
🧠 Review effort: Lite
Co-authored-by: Codex <codex@openai.com>
Reject null snapshot references and cover format versions, batching, projection, task lifetime, repeated Arrow errors, and time-travel rejection. Organize metadata tests under test/inspect and use the existing metadata batch helper. Co-authored-by: Codex <codex@openai.com>
bd8e6c8 to
e603e6d
Compare


Add the refs metadata table so callers can inspect a table's branches and tags through
Table::Inspect(MetadataTableKind::kRefs). Rows are sorted by reference name and expose six columns:name,type(BRANCHorTAG),snapshot_id,max_reference_age_in_ms,min_snapshots_to_keep, andmax_snapshot_age_in_ms. Unset retention values are null.RefsTableandRefsScanuse the current metadata scan builder, static tasks, and shared batch helper. They support column selection and projection, configurable batch sizes, and tasks and streams that retain their inputs. Time-travel options returnkNotSupported. Null source tables returnkInvalidArgument; null snapshot references returnkInvalidwhen opening a task, with errors preserved through repeated Arrow C stream reads.Move the existing metadata tests and shared fixture into
src/iceberg/test/inspect. Refs coverage includes format versions 1, 2, and 3, branch and tag values, null retention fields, empty tables, batch boundaries, projection and selection, task and stream lifetimes, and invalid inputs.Validation: all 55 tests in
metadata_table_testpassed, including 25 refs tests, using a Debug build with system Arrow 23.0.1.pre-commitandgit diff --checkpassed.